import request from '@/utils/request'

/**
 * 登录-获取token
 * @param data
 * @returns {AxiosPromise}
 */
export function login(data) {
  return request({
    url: '/crm/api/get/token',
    method: 'post',
    data
  })
}

/**
 * 刷新token
 * @param data
 * @returns {AxiosPromise}
 */
export function refreshToken(data) {
  return request({
    url: '/crm/api/refresh/token',
    method: 'post',
    data
  })
}

/**
 * 登出
 * @returns {AxiosPromise}
 */
export function logout() {
  return request({
    url: '/crm/api/sys/logout',
    method: 'post'
  })
}

/**
 * 获取用户个人信息
 * @returns {AxiosPromise}
 */
export function getInfo() {
  return request({
    url: '/crm/api/user/info',
    method: 'get'
  })
}


